<td> 

<!------------------------------------------------------------------------>
<script>

function selectType()
{
	document.getElementById("generateReportBtn").disabled=false;
}

function generateReport()
{
	var reportSelection = document.getElementById("report_selected");
	reportSelected = reportSelection.options[reportSelection.selectedIndex].value;
	document.getElementById("reportAction").value=reportSelected;
	document.reportForm.submit();
}

</script>


	<div class="round2Inventory">
	<table class="content">
	<tr><td style="border: 0px solid pink;">

	<form name="reportForm" action="#" method="post">
	
	
	
	<input type="hidden" id="reportAction" name="reportAction" value="generateReport">

	<table style="border: 0px solid red; width:100%;">
	<tr>
		<td>
			Report type<span class="red">*</span>:
			<select id="report_selected" name="report_selected" onchange="selectType()" style="width:150px">
				<option></option>
				<option value="inventoryNeeded">Inventory Prediction</option>
				<option value="inventoryUsed">Inventory Used</option>
				<option value="appointmentHours">Appointment Hours</option>
				<option value="procedurePerformed">Procedure Performed</option>
			</select>
		</td>
		<td>
			Start date<br>(yyyy-mm-dd)<span class="red">*</span>:
			<input type="text" id="startDate" name="startDate" style="width:100px">
		</td>
		<td>
			End date<br>(yyyy-mm-dd)<span class="red">*</span>: 
			<input type="text" id="endDate" name="endDate" style="width:100px">  
		</td>
		<td>	
			<input type="submit" id="generateReportBtn" value="Generate Report" " onclick="generateReport()" disabled>
		</td>
	</tr>
	
	<tr>
		<td style="width:50%;" colspan="4"><br><br>
		
		<div style="overflow:hidden; overflow-y:auto; height:350px;">
		
			<table style="border:0px solid black; width:50%; text-align:center; margin-left:300px; ">
			<?php
				///////////////////////////////////////////////////////////////Procedure Performed
				if(isset($allProceduresPerformed))
				{
					//print_r($allProceduresPerformed);
					
					echo "<tr>";
					echo "<th colspan='4'><u>Procedure Performed Report</u><br><br></th>";
					echo "</tr>";
					
					echo "<tr>";
					echo "<th>ID</th>";
					echo "<th>Procedure Name</th>";
					echo "<th>Procedure Count</th>";
					echo "</tr>";
					
					foreach($allProceduresPerformed as $a)
					{
						echo "<tr>";
						echo "<td>".$a[0]."</td>";
						echo "<td>".$a[1]."</td>";
						echo "<td>".$a[2]."</td>";
						echo "</tr>";
					}
					
				}
				///////////////////////////////////////////////////////////////Inventory Prediction
				if(isset($allInventoryNeeded))
				{
					//print_r($allInventoryNeeded);
					echo "<tr>";
					echo "<th colspan='4'><u>Inventory Prediction Report</u><br><br></th>";
					echo "</tr>";
					
					echo "<tr>";
					echo "<th>ID</th>";
					echo "<th>Product Name</th>";
					echo "<th>Quantity Needed</th>";
					echo "<th>Quantity At Hand</th>";
					echo "</tr>";
					
					foreach($allInventoryNeeded as $a)
					{
						echo "<tr>";
						echo "<td>".$a[0]."</td>";
						echo "<td>".$a[1]."</td>";
						echo "<td>".$a[2]."</td>";
						echo "<td>".$a[3]."</td>";
						echo "</tr>";
					}
				}
				///////////////////////////////////////////////////////////////Inventory Used
				if(isset($allInventoryUsed))
				{
					//print_r($allInventoryUsed);
					
					echo "<tr>";
					echo "<th colspan='3'><u>Inventory Used Report</u><br><br></th>";
					echo "</tr>";
					
					echo "<tr>";
					echo "<th>ID</th>";
					echo "<th>Product Name</th>";
					echo "<th>Quantity Used</th>";
					echo "</tr>";
					
					foreach($allInventoryUsed as $a)
					{
						echo "<tr>";
						echo "<td>".$a[0]."</td>";
						echo "<td>".$a[1]."</td>";
						echo "<td>".$a[2]."</td>";
						echo "</tr>";
					}
				}
				///////////////////////////////////////////////////////////////Appointment Hours
				if(isset($allAppointmentHours))
				{
					//print_r($allAppointmentHours);
					
					$sumHour=(int)($allAppointmentHours[0]/60);
					$sumMin=($allAppointmentHours[0]%60);
					
					$avgHour=(int)($allAppointmentHours[1]/60);
					$avgMin=($allAppointmentHours[1]%60);
					
					echo "<tr>";
					echo "<th><u>Appointment Hours Report</u><br><br></th>";
					echo "</tr>";
					
					
					echo "<tr>";
					echo "<td>";
					echo "The total time spent on appointments between specified dates was: ".$sumHour." Hours and ".$sumMin." Minutes";
					echo "</td>";
					echo "</tr>";
					
					echo "<tr>";
					echo "<td>";
					echo "The average time spent on one appointment between specified dates was: ".$avgHour." Hours and ".$avgMin." Minutes";
					echo "</td>";
					echo "</tr>";
				}
			?>
			</table>
			
			</div>
		</td>
	</tr>
	
	</table>
	
	
	</form>
	</td></tr>
	</table>
	</div>
					
<!------------------------------------------------------------------------>
			
			</td>
		</tr>